package com.lee.dutylower.db.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lee.dutylower.db.greenEntity.PostRecord;
import com.lee.dutylower.db.greenEntity.Sentry;
import com.lee.dutylower.db.greenEntity.Soldier;
import com.lee.dutylower.db.greenEntity.SoldierSentry;
import com.lee.dutylower.db.greenEntity.Squad;
import com.lee.dutylower.db.greenEntity.SquadRecord;
import com.lee.dutylower.db.greenEntity.Times;
import com.lee.dutylower.db.greenEntity.DutySoldierRecord;

import com.lee.dutylower.db.greendao.PostRecordDao;
import com.lee.dutylower.db.greendao.SentryDao;
import com.lee.dutylower.db.greendao.SoldierDao;
import com.lee.dutylower.db.greendao.SoldierSentryDao;
import com.lee.dutylower.db.greendao.SquadDao;
import com.lee.dutylower.db.greendao.SquadRecordDao;
import com.lee.dutylower.db.greendao.TimesDao;
import com.lee.dutylower.db.greendao.DutySoldierRecordDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig postRecordDaoConfig;
    private final DaoConfig sentryDaoConfig;
    private final DaoConfig soldierDaoConfig;
    private final DaoConfig soldierSentryDaoConfig;
    private final DaoConfig squadDaoConfig;
    private final DaoConfig squadRecordDaoConfig;
    private final DaoConfig timesDaoConfig;
    private final DaoConfig dutySoldierRecordDaoConfig;

    private final PostRecordDao postRecordDao;
    private final SentryDao sentryDao;
    private final SoldierDao soldierDao;
    private final SoldierSentryDao soldierSentryDao;
    private final SquadDao squadDao;
    private final SquadRecordDao squadRecordDao;
    private final TimesDao timesDao;
    private final DutySoldierRecordDao dutySoldierRecordDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        postRecordDaoConfig = daoConfigMap.get(PostRecordDao.class).clone();
        postRecordDaoConfig.initIdentityScope(type);

        sentryDaoConfig = daoConfigMap.get(SentryDao.class).clone();
        sentryDaoConfig.initIdentityScope(type);

        soldierDaoConfig = daoConfigMap.get(SoldierDao.class).clone();
        soldierDaoConfig.initIdentityScope(type);

        soldierSentryDaoConfig = daoConfigMap.get(SoldierSentryDao.class).clone();
        soldierSentryDaoConfig.initIdentityScope(type);

        squadDaoConfig = daoConfigMap.get(SquadDao.class).clone();
        squadDaoConfig.initIdentityScope(type);

        squadRecordDaoConfig = daoConfigMap.get(SquadRecordDao.class).clone();
        squadRecordDaoConfig.initIdentityScope(type);

        timesDaoConfig = daoConfigMap.get(TimesDao.class).clone();
        timesDaoConfig.initIdentityScope(type);

        dutySoldierRecordDaoConfig = daoConfigMap.get(DutySoldierRecordDao.class).clone();
        dutySoldierRecordDaoConfig.initIdentityScope(type);

        postRecordDao = new PostRecordDao(postRecordDaoConfig, this);
        sentryDao = new SentryDao(sentryDaoConfig, this);
        soldierDao = new SoldierDao(soldierDaoConfig, this);
        soldierSentryDao = new SoldierSentryDao(soldierSentryDaoConfig, this);
        squadDao = new SquadDao(squadDaoConfig, this);
        squadRecordDao = new SquadRecordDao(squadRecordDaoConfig, this);
        timesDao = new TimesDao(timesDaoConfig, this);
        dutySoldierRecordDao = new DutySoldierRecordDao(dutySoldierRecordDaoConfig, this);

        registerDao(PostRecord.class, postRecordDao);
        registerDao(Sentry.class, sentryDao);
        registerDao(Soldier.class, soldierDao);
        registerDao(SoldierSentry.class, soldierSentryDao);
        registerDao(Squad.class, squadDao);
        registerDao(SquadRecord.class, squadRecordDao);
        registerDao(Times.class, timesDao);
        registerDao(DutySoldierRecord.class, dutySoldierRecordDao);
    }
    
    public void clear() {
        postRecordDaoConfig.clearIdentityScope();
        sentryDaoConfig.clearIdentityScope();
        soldierDaoConfig.clearIdentityScope();
        soldierSentryDaoConfig.clearIdentityScope();
        squadDaoConfig.clearIdentityScope();
        squadRecordDaoConfig.clearIdentityScope();
        timesDaoConfig.clearIdentityScope();
        dutySoldierRecordDaoConfig.clearIdentityScope();
    }

    public PostRecordDao getPostRecordDao() {
        return postRecordDao;
    }

    public SentryDao getSentryDao() {
        return sentryDao;
    }

    public SoldierDao getSoldierDao() {
        return soldierDao;
    }

    public SoldierSentryDao getSoldierSentryDao() {
        return soldierSentryDao;
    }

    public SquadDao getSquadDao() {
        return squadDao;
    }

    public SquadRecordDao getSquadRecordDao() {
        return squadRecordDao;
    }

    public TimesDao getTimesDao() {
        return timesDao;
    }

    public DutySoldierRecordDao getDutySoldierRecordDao() {
        return dutySoldierRecordDao;
    }

}
